package com.clkj.goldpartner.service.impl;

import com.clkj.goldpartner.dao.CategoryMapper;
import com.clkj.goldpartner.pojo.Category;
import com.clkj.goldpartner.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 杨阿旺
 * @date 2021-02-28 16:32
 */
@Service
public class CategoryServiceImpl implements CategoryService {
    @Autowired
    private CategoryMapper categoryMapper;

    /**
     * 新增分类
     *
     * @param Category
     */
    @Override
    public void addCategory(Category Category) {
        categoryMapper.addCategory(Category);
    }

    /**
     * 查询分类列表
     *
     * @param shop_id
     * @param shop_id
     * @return
     */
    @Override
    public List<Category> listCategories(Integer shop_id, Integer parent_id) {
        return categoryMapper.listCategories(shop_id, parent_id);
    }

    /**
     * 添加商品获取分类
     *
     * @param shop_id
     * @return
     */
    @Override
    public List<Category> getCategories(Integer shop_id) {
        return categoryMapper.getCategories(shop_id);
    }
}
